<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>百商汇</title>
	<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0,minimum-scale = 1.0,user-scalable = no,width = device-width">
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" type="text/css" href="../csses/withdrawalList.css">
</head>
<body>
	<div class="withdrawalList_title">
		提现列表
		<img src="../image/back.png" onclick="goBack()">
	</div>
	<div class="withdrawalList_box">
		<div id="wrapper">
			<ul>
				<!-- <li>
					<p class="p1">请问的人风格让他好友推荐请问的人风格让他好友推荐请问的人风格让他好友推荐</p>
					<p class="p2">
						<span class="span1">状态：通过</span>
						<span class="span2">2016-10-14 11:11:11</span>
					</p>
				</li> -->
			</ul>
		</div>
	</div>

	<div id="remindBox"></div>
	<script type="text/javascript" src="../lib/flexible.js"></script>
	<script type="text/javascript" src="../lib/jquery-1.10.1.min.js"></script>
	<script type="text/javascript" src="../lib/iscroll.js"></script>
	<script type="text/javascript" src="../javascript/pullToRefresh.js"></script>
	<script type="text/javascript">
		onload = function(){
			getList(1);
		}

		function goBack(){
			window.history.back();
		}

		function remind(message){
			$('#remindBox').css('display','block').text(message);
			setTimeout(function(){
				$('#remindBox').css('display','none');
			},1500);
		}

		function getList(page){
			$.ajax({
				type : 'post',
				url : '/api/v1/finance/transfer/withdrawlList',
				data : {
					paramStr: "{'userName':'" + sessionStorage.userName + "','token':'" + sessionStorage.token + "','pageIndex':'" + page + "','pageSize':'" + 10 + "'}"
				},
				dataType : 'json',
				timeout : 10000,
				success : function (data) {
					if(data.code == 200){
						var obj = JSON.parse(data.data);
						var billsList = obj.bills_list;
						if(billsList.length != 0){
							var $ul = $('#wrapper ul');
							for(var i in billsList){
								var status,time;
								if(billsList[i].audit_status == 0){
									status = '待审核';
									time = billsList[i].apply_time;
								}else if(billsList[i].audit_status == 1){
									status = '通过';
									time = billsList[i].apply_time;
								}else if(billsList[i].audit_status == 2){
									status = '未通过';
									time = billsList[i].apply_time;
								}else if(billsList[i].audit_status == 3){
									status = '成功';
									time = billsList[i].pay_time;
								}
								var $li = $('<li></li>').appendTo($ul);
								$('<p></p>').addClass('p1').text('您向'+billsList[i].name+':'+billsList[i].bank_card+'卡号提现'+billsList[i].money+'元').appendTo($li);
								var $p2 = $('<p></p>').addClass('p2').appendTo($li);
								$('<span></span>').addClass('span1').text(status).appendTo($p2);
								$('<span></span>').addClass('span2').text(time).appendTo($p2);
							}
						}else{
							remind('无更多信息');
						}
					}
				},
				error : function (xhr,type,errorThrown){
					// alert('.....');
				}
			});
		}
		


		var abc = 1;
		
		refresher.init({
			id:"wrapper",
			pullUpAction:Load
		});																																							
		function Load(){
			abc++;
			getList(abc);
			wrapper.refresh();
		}
	</script>
</body>
</html>